package com.contract.spirit.manage

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import com.contract.commonlib.util.CommonUtils
import com.contract.spirit.R

/**
 * @author zhengjun
 * @desc
 * @create at 2021/6/27 10:34
 */
object EmptyViewManger {
    fun getEmptyView(mContext: Context?, tips: String?): View {
        val inflate = LayoutInflater.from(mContext).inflate(R.layout.net_no_data_layout, null)
        val tvTips = inflate.findViewById<TextView>(R.id.tv_tips)
        tvTips.text = tips
        return inflate
    }

    fun getEmptyView(mContext: Context?, tips: String?, dimenId: Int): View {
        val inflate = LayoutInflater.from(mContext).inflate(R.layout.net_no_data_layout, null)
        val tvTips = inflate.findViewById<TextView>(R.id.tv_tips)
        CommonUtils.setMarginTop(tvTips, CommonUtils.getDimension(dimenId))
        tvTips.text = tips
        return inflate
    }
}